-
-
Notifications
You must be signed in to change notification settings - Fork 247
Fix second element of forms starting with 'def' being highlighted as function name #632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Maybe it's better to also remove optional namespace from regexp? I mean, to allow only Line 883 in 68e0e13
|
Yeah, that'd be better. It used to accept all namespaces just because it could be anything. |
ef4f673
to
586d091
Compare
Done |
test/clojure-mode-font-lock-test.el
Outdated
@@ -780,13 +780,13 @@ DESCRIPTION is the description of the spec." | |||
(2 4 font-lock-type-face) | |||
(5 5 nil) | |||
(6 9 font-lock-keyword-face) | |||
(11 13 font-lock-function-name-face)) | |||
(11 13 nil)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this example should be updated to use clojure-core
, otherwise it's kind of pointless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense. Done
test/clojure-mode-font-lock-test.el
Outdated
|
||
("(clo/defrecord foo nil)" | ||
(2 4 font-lock-type-face) | ||
(5 5 nil) | ||
(6 14 font-lock-keyword-face) | ||
(16 18 font-lock-function-name-face)) | ||
(16 18 nil)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to me this example needs to be updated as well to use clojure.core
, as I doubt they would be a different ns for defrecord
. Also we should probably make defrecord
and deftype
use font-lock-type-face
for the name of the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced namespace with clojure.core
.
Also we should probably make defrecord and deftype use font-lock-type-face for the name of the type.
We already do, I didn't change that. I changed the test to check if this face is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't 16-18 the name of the type foo
? It seems it has no font-locking now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see this wasn't working because of the wrong namespace. My bad.
It's good we have so many tests - they helped me spot two weird behaviors currently that it would be nice to address. |
586d091
to
8652558
Compare
Looks good now. Thanks! |
Follow up to #630
Forgot to make function definition regexp only look for

defn
forms. This PR will fix such behaviour:Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):
M-x checkdoc
and fixed any warnings in the code you've written.Thanks!